/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test_system.questions;

/**
 *
 * @author root
 */
public class TextAnswerQuestion extends Question {

    Answer answer;

    public TextAnswerQuestion(String questionBody, Answer answer) {
        this.questionBody = questionBody;
        this.answer = answer;
    }

    public String toString() {
        return questionBody;
    }

    public Answer getRightAnswer() {
        return answer;
    }

    @Override
    public String toWrite() {
        StringBuffer res = new StringBuffer();
        res.append(questionBody);
        res.append("|");
        res.append(answer.answerBody);
        return res.toString();

    }
}
